package com.xc.utils.redis;

/**
 *  redis const常量类
 * Created by xiongcan on 2018/2/12.
 */
public class RedisConst {

    //  redis config

    public interface RedisKeyPrefix{
        String ADMIN_PREFIX="ADMIN";
        String USER_PREFIX="USER";
        String AGENT_PREFIX="AGENT";
    }

    //  redis cache 过期时间
    public interface RedisCacheExTime{
        int REDIS_SESSION_EXTIME = 60 * 90; //80分钟

        //  email 审核 auth 的token过期时间，5分钟
        int REDIS_EMAIL_TOKEN_EXTIME = 60 * 5;
    }

    //  redis 锁的常量
    public interface REDIS_LOCK{
        String CLOSE_ORDER_TASK_LOCK = "CLOSE_ORDER_TASK_LOCK";
    }

    public static String getAdminRedisKey(String sessionId){
        return RedisKeyPrefix.ADMIN_PREFIX + sessionId;
    }
    public static String getAgentRedisKey(String sessionId){
        return RedisKeyPrefix.AGENT_PREFIX + sessionId;
    }
    public static String getUserRedisKey(String sessionId){
        return RedisKeyPrefix.USER_PREFIX + sessionId;
    }



}
